import React, {Component} from 'react';
import {
  Layout,
  Menu,
  Breadcrumb,
  Modal,
  Form,
  Input,
  Select,
  DatePicker,
  Popconfirm,
  Card,
  Row,
  Col,
  Button,
  Dropdown,
  Icon,
  Upload,
  message,
  Table,
  Pagination,
  Checkbox
} from 'antd';
const {Header, Content, Footer} = Layout;
import {hashHistory, Link} from 'dva/router';
const LineChart = require('react-d3-basic').LineChart;
import _ from 'underscore';

import styles from './main.less'
import * as UserModel from '../model/user'

const current_user = UserModel.loadCacheUser()
export default class _Page extends React.Component {
  constructor(props) {
    super(props);
    console.log('_wrap.js', props)
  }
  render() {
    if ('phone' in current_user) {
      return (
        <div>{this.props.children}</div>
      );
    } else {
      return (
        <div style={{
          backgroundColor: 'white'
        }}>
          你不该到这里，因为你还没有登录 {location.pathname}
          <Link to={"/login"}>去登录</Link>
        </div>
      )
    }
  }
}
